/*
* Copyright © 2018 Union Mobile Financial Technology Co.Ltd
* All Rights Reserved
* @Description: TODO(功能描述)
* @author lile 
* @date 2018年8月8日 下午3:49:56
*
*/ 
package com.umpay.controller.payment;

import com.umpay.annotation.ReceiveEntity;
import com.umpay.business.payment.PaymentBusinessService;
import com.umpay.controller.base.AbstractController;
import com.umpay.dto.UMFResponse.Message;
import com.umpay.dto.merAccess.req.payment.PaymentCodePayAccessReq;
import com.umpay.dto.merAccess.res.payment.PaymentCodePayAccessRes;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
***********************************************************
* @ClassName: PaymentCodePayController
* @Description: 支付码支付(被扫)-微信刷卡支付、支付宝条码支付
* @author lile
* @date 2018年8月8日 下午3:49:56
* @version 1.0 
*
* Modification History:
* Date         Author          Version            Description
*---------------------------------------------------------*
* 2018年8月8日     lile           v1.0.0               修改原因
************************************************************
*/
@RestController
public class PaymentCodePayController extends AbstractController {
	
	private static final Logger log = LoggerFactory.getLogger(PaymentCodePayController.class);
	
	@Autowired
	private PaymentBusinessService paymentBusinessServiceImpl;
	
	@PostMapping(value="/payment/paymentCodePay")
	@ReceiveEntity(type = PaymentCodePayAccessReq.class)
	public Message<PaymentCodePayAccessRes> paymentCodePay(HttpServletRequest request,HttpServletResponse response) {
		PaymentCodePayAccessReq req = getReqMessage(request);
		log.info("【扫码支付-用户被扫】Controller|######『收到请求』######:[%s]", req);
		Message<PaymentCodePayAccessRes> resMessage = this.paymentBusinessServiceImpl.paymentCodePay(req);
		log.info("【扫码支付-用户被扫】Controller|######『响应结果』######:[%s]", resMessage);
		return responseMsg(resMessage, response);
		
	}

}
